package cn.edu.scujcc;

import java.util.List;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ClockService {
	@Autowired
	private ClockRepository repo;
	
	public Clock createClock(Clock c) {
		Clock result = null;
		result = repo.save(c);
		return result;
	}

	public boolean deleteClock(String sd) {
		boolean result = true;
		try {
			repo.deleteById(sd);
		} catch (Exception c) {
			result = false;
		}
		return result;
	}

	public List<Clock> getAllClock() {
		List<Clock> result = null;
		result = repo.findAll();
		return result;
	}
}
